package com.gw.smscheck.controller;

import com.gw.smscheck.entity.sys.LoginUser;
import com.gw.smscheck.service.sys.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 * 路由跳转
 * @author ASUS
 *
 */
@Controller
@RequestMapping("/")
@ApiIgnore
public class RouteController {

	@Autowired
	private LoginService loginService;

	/**
	 * PC端实时人数、累计人数
	 *
	 * 无路径跳转
	 */
	@RequestMapping("/")
	public ModelAndView goLogin2() {
		//ModelAndView mv = new ModelAndView("login");
		ModelAndView mv = new ModelAndView("views/business/static/statics");
		return mv;
	}

	/**
	 * 一体机上展示实时人数、累计人数：360 × 240
	 */
	@RequestMapping("/statics")
	public ModelAndView statics() {
		ModelAndView mv = new ModelAndView("views/business/static/small");
		return mv;
	}

	/**
	 * LED屏上展示实时人数、累计人数：540 × 480
	 */
	@RequestMapping("/large")
	public ModelAndView large() {
		ModelAndView mv = new ModelAndView("views/business/static/large");
		return mv;
	}

	@RequestMapping("/test")
	public ModelAndView test() {
		ModelAndView mv = new ModelAndView("views/business/static/test");
		return mv;
	}

	@RequestMapping("/comefrom")
	public ModelAndView comeFrom() {
		ModelAndView mv = new ModelAndView("views/business/comefrom/comefrom");
		return mv;
	}

	/**
	 * 首页
	 * 
	 * @return
	 */
	@RequestMapping("/admin")
	public ModelAndView goPage() {
		ModelAndView mv = new ModelAndView("index");
		return mv;
	}
	/**
	 * 主页
	 *
	 * @return
	 */
	@RequestMapping("/home")
	public ModelAndView goHome() {
		ModelAndView mv = new ModelAndView("home");
		return mv;
	}
	/**
	 * 404
	 *
	 * @return
	 */
	@RequestMapping("/404")
	public ModelAndView go404() {
		ModelAndView mv = new ModelAndView("404");
		return mv;
	}
	/**
	 *
	 * 500
	 *
	 * @return
	 */
	@RequestMapping("/500")
	public ModelAndView go500() {
		ModelAndView mv = new ModelAndView("500");
		return mv;
	}
	/**
	 * 登录页面
	 *
	 * @return
	 */
	@RequestMapping("/login")
	public ModelAndView goLogin() {
		ModelAndView mv = new ModelAndView("login");
		return mv;
	}
	/**
	 * 注册页面
	 *
	 * @return
	 */
	@RequestMapping("/register")
	public ModelAndView goLogon() {
		ModelAndView mv = new ModelAndView("register");
		return mv;
	}
	/**
	 * 测试页面
	 *
	 * @return
	 */
	@RequestMapping("/api")
	public ModelAndView goTest() {
		ModelAndView mv = new ModelAndView("test/test");
		return mv;
	}
	/**
	 * table页面
	 *
	 * @return
	 */
	@RequestMapping("/table")
	public ModelAndView goTable() {
		ModelAndView mv = new ModelAndView("table");
		return mv;
	}
	/**
	 * 菜单管理页面
	 *
	 * @return
	 */
	@RequestMapping("/menus")
	public ModelAndView goMenu() {
		ModelAndView mv = new ModelAndView("views/systemManagement/menus");
		return mv;
	}
	/**
	 * 用户管理页面
	 *
	 * @return
	 */
	@RequestMapping("/users")
	public ModelAndView goUsers() {
		ModelAndView mv = new ModelAndView("views/systemManagement/users");
		return mv;
	}
	/**
	 * 角色管理页面
	 *
	 * @return
	 */
	@RequestMapping("/roles")
	public ModelAndView goRoles() {
		ModelAndView mv = new ModelAndView("views/systemManagement/roles");
		return mv;
	}
	/**
	 * 部门管理页面
	 *
	 * @return
	 */
	@RequestMapping("/department")
	public ModelAndView goDepartment() {
		ModelAndView mv = new ModelAndView("views/systemManagement/department");
		return mv;
	}
	/**
	 * 数据字典管理页面
	 *
	 * @return
	 */
	@RequestMapping("/dataDictionary")
	public ModelAndView goDataDictionary() {
		ModelAndView mv = new ModelAndView("views/systemManagement/dataDictionary");
		return mv;
	}
	/**
	 * 组件测试
	 *
	 * @return
	 */
	@RequestMapping("/view")
	public ModelAndView goView() {
		ModelAndView mv = new ModelAndView("test/view");
		return mv;
	}

	/**
	 * 地图区域绘制
	 *
	 * @return
	 */
	@RequestMapping("/mapregion")
	public ModelAndView goMapRegion() {
		ModelAndView mv = new ModelAndView("views/mapApplication/mapRegion");
		return mv;
	}

	/**
	 * 地图轨迹
	 *
	 * @return
	 */
	@RequestMapping("/maptrajectory")
	public ModelAndView goMapTrajectory() {
		ModelAndView mv = new ModelAndView("views/mapApplication/mapTrajectory");
		return mv;
	}
	/**
	 * 跳转到日志查询页面
	 *
	 * @return
	 */
	@RequestMapping("/goLogPage")
	public ModelAndView goLogPage() {
		ModelAndView mv = new ModelAndView("views/systemManagement/log");
		return mv;
	}
	/**
	 * 跳转到重点关注人员页面
	 *
	 * @return
	 */
	@RequestMapping("/goFocusCrowdPage")
	@ApiIgnore
	public ModelAndView goFocusCrowdPage() {
		ModelAndView mv = new ModelAndView("views/business/focusCrowd/focusCrowd");
		return mv;
	}
	/**
	 * 人群监控地图主页
	 *
	 * @return
	 */
	@RequestMapping("/map")
	@ApiIgnore
	public ModelAndView goMap() {
		ModelAndView mv = new ModelAndView("Map");
		return mv;
	}
	/**
	 * 小工具页面
	 *
	 * @return
	 */
	@RequestMapping("/tools")
	@ApiIgnore
	public ModelAndView goTools() {
		ModelAndView mv = new ModelAndView("views/business/tools/tools");
		return mv;
	}
	/**
	 * 页面
	 *
	 * @return
	 */
	@RequestMapping("/goCallRecordsPage")
	@ApiIgnore
	public ModelAndView goCallRecords() {
		ModelAndView mv = new ModelAndView("views/business/callRecords/callRecords");
		return mv;
	}
	/**
	 * 轨迹预判页面
	 *
	 * @return
	 */
	@RequestMapping("/prognosis")
	@ApiIgnore
	public ModelAndView goPrognosis() {
		ModelAndView mv = new ModelAndView("views/mapOperation/trailPrognosis");
		return mv;
	}
	/**
	 * 轨迹播放页面
	 *
	 * @return
	 */
	@RequestMapping("/trailPlay")
	@ApiIgnore
	public ModelAndView goTrailPlay(String phoneNum,String time) {
		ModelAndView mv = new ModelAndView("views/mapApplication/mapTrajectory");
		if (phoneNum != null&& phoneNum!="") {
			mv.addObject("phoneNum", phoneNum);
		}
		if (time != null&& time!="") {
			mv.addObject("time", time);
		}
		return mv;
	}
    /**
     * 密切联系人页面
     *
     * @return
     */
    @RequestMapping("/relation")
    @ApiIgnore
    public ModelAndView goRelation() {
        ModelAndView mv = new ModelAndView("views/mapApplication/relation");
        return mv;
    }
	/**
	 * 修改密码页面
	 *
	 * @return
	 */
	@RequestMapping("/updatePwd")
	@ApiIgnore
	public ModelAndView updatePwd() {
		List<LoginUser> list = loginService.findAll();
		ModelAndView mv = new ModelAndView("views/systemManagement/updatepwd");
		mv.addObject("user1",list.get(0));
		mv.addObject("user2",list.get(1));
		return mv;
	}
	/**
	 * 跳转到查询页面
	 *
	 * @return
	 */
	@RequestMapping("/goPositionArea")
	@ApiIgnore
	public ModelAndView goPositionArea() {
		ModelAndView mv = new ModelAndView("views/business/position/positionArea");
		return mv;
	}
	/**
	 * 跳转到告警管理页面
	 *
	 * @return
	 */
	@RequestMapping("/goAlarmLog")
	@ApiIgnore
	public ModelAndView goAlarmLog() {
		ModelAndView mv = new ModelAndView("views/business/alarm/alarmLogList");
		return mv;
	}
}
